$(document).ready(function()
{
    $("input:submit, input:button").button();

    $("#accordionAlumno").accordion({
        event: "click"
    });

    $("#frmAlumno").validate({

        submitHandler: function(form) {
            form.submit();
        },
        onfocusout: function(element) {
            if ( !this.checkable(element)) {
                this.element(element);
            }
        },
        rules: {
            nombre: {
                required: true
            },
            apellido: {
                required: true
            },
            documentos: {
                required: true,
                number: true
            },
            numeroDocumento: {
                required : true,
                minlength: 10
            }
        },
        messages: {
            documentos:{
                number: "Requerido"
            },
            numeroDocumento: {
                minlength: "Incorrecto"
            }
        },
        success: function(label) {
            $(label).addClass("checked");
        }
    });
});